#!/usr/bin/env python
#-*- coding: utf-8 -*-
#@Time:2020/7/8 11:03 上午
#@Author:boyizhang
"""
功能:读取json数据，返回json对象
"""
import json
class ReadJson(object):
    #初始化json地址
    def __init__(self,fileName):
        self.filePath='./data/'+fileName
        print(self.filePath)
    #读取json
    def read_json(self):
        try:
            with open(self.filePath,"r",encoding="utf-8") as f:
                #调用load方法加载文件流
                return json.load(f)
        except:
            print(self.filePath,"文件不存在")



